﻿using LDM.Framework.WebApiClientCore;
using LDM.Sys.ServiceAPI.Model.DBModel;
using LDM.Sys.ServiceAPI.Model.ViewModel.Request.AuthorityReq;
using LDM.Sys.ServiceAPI.Model.ViewModel.Response.Authority;
using Microsoft.Extensions.DependencyInjection;
using Model.Models;
using WebApiClientCore;
using WebApiClientCore.Attributes;

namespace LDM.Sys.ServiceAPI.Svc
{
    /// <summary>
    /// 菜单服务
    /// </summary>
    [HttpApiOptions("LDM.Sys.API")]
    [LoggingFilter]
    [Timeout(10 * 1000)] // 10s超时
    public interface IRoleService : IHttpApi, IScoped
    {
        /// <summary>
        /// 角色列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SysRole/GetSysRoles")]
        public Task<PageResult<RoleRes>> GetSysRoles([JsonContent] GetSysRoleReq request);

        /// <summary>
        ///  添加角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SysRole/AddSysRole")]
        public Task AddSysRole([JsonContent] AddSysRoleReq request);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SysRole/UpdateSysRole")]
        public Task UpdateSysRole([JsonContent] UpdateSysRoleReq request);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("SysRole/DelSysRole")]
        public Task DelSysRole([JsonContent] DelSysRoleReq request);

        /// <summary>
        /// 设置角色下用户
        /// </summary>
        /// <returns></returns>
        [HttpPost("SysRole/SetRoleAccounts")]
        public Task SetRoleAccounts([JsonContent] SetRoleAccountsReq request);

        /// <summary>
        /// 获取角色下的用户信息
        /// </summary>
        [HttpPost("SysRole/GetUserByRoleId")]
        public Task<List<int>> GetUserByRoleId(int roleId);
    }
}
